package c

import (
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

// CommunityRouter 社区模块相关路由信息
type CommunityRouter struct{}

func (con *CommunityRouter) InitCommunityRouter(Router *gin.RouterGroup) {
	communityRouter := Router.Group("community").Use(middleware.JWTAuth())
	//communityRouter := Router.Group("community")
	{
		communityRouter.GET("getCommunityDetail", communityApi.GetCommunityDetail)                           // 获取社区详情
		communityRouter.POST("getCommunityList", communityApi.GetCommunityList)                              // 获取社区列表
		communityRouter.POST("joinCommunity", communityApi.JoinCommunity)                                    // 加入社区
		communityRouter.POST("leaveCommunity", communityApi.LeaveCommunity)                                  // 离开社区
		communityRouter.GET("getMajorCategoriesWithCommunity", communityApi.GetMajorCategoriesWithCommunity) // 获取专业大类及对应社区id
		communityRouter.POST("ValidateCommunityMajorRelation", communityApi.ValidateCommunityMajorRelation)  // 校验专业类与社区对应
		communityRouter.GET("getCommunityTree", communityApi.GetCommunityTree)                               // 获取社区二层树结构
		communityRouter.GET("simpleTree", communityApi.GetSimpleCommunityTree)                               // 获取社区二层树简单结构
	}
}
